.TH RSTPCTL 8 "August 20, 2006" "" ""
.SH NAME
rstpctl \- rstpd spanning tree protocol administration
.SH SYNOPSIS
.BR "rstpctl [command]"
.SH DESCRIPTION
.B rstpctl
is used to set up, maintain, and inspect the bridge RSTP
configuration for ethernet bridges as implemented using
.BR rstpd (8).
.BR rstpd
implements the spanning tree algorithm specified by the Rapid Spanning
Tree Protocol (RSTP). An implementation of the original Spanning Tree
Protocol (STP) is provided by the Linux kernel bridging code and can
be enabled and controlled using the
.BR "brctl"
command.

.SH COMMANDS

.B rstpctl rstp <bridge> {on|off}
configures whether rstpd implements RSTP (Rapid Spanning Tree
Protocol) for the specified bridge. The remaining commands are
applicable only if rstpd is configured to run RSTP on that bridge.

.B rstpctl showbridge [<bridge> ... ]
displays the spanning tree configuration and status for the specified
bridges. If no bridges are given, it displays the information for all
bridges.

.B rstpctl showport <bridge> [<port> ... ]
displays, as one line per port, the spanning tree configuration and
status for the specified ports. If no ports are specified, it displays
the information for all ports of the bridge.

The format of the line is :
.br
.B "pes  name iiii sss  rrrr-rootbridgeid dddd-desgbridgeid dprt R"
.br
where the following abbreviations are used.

\fBp\fR: '*' if the port link is not point to point, ' ' otherwise.
.br
\fBe\fR: 'E' if the port is operating as an edge port, ' ' otherwise.
.br
\fBs\fR: 's' if the port is in STP (slow) mode, ' ' otherwise.
.br
\fBname\fR: The name of the port, i.e, the network interface name.
.br
\fBiiii\fR: The port id, containing the port priority and port number
.br
\fBsss\fR: The port state, one of Dis (disabled), Blk (blocking), Lrn
(learning), Fwd (forwading), Non (non-stp), Unk (unknown).
.br
\fBrrrr-rootbridgeid\fR: Root bridge id, including priority.
.br
\fBdddd-desgbridgeid\fR: Designated bridge id, including priority
.br
\fBdprt\fR: Designated port id
.br
\fBR\fR: Port role, one of 'A' (alternate), 'B' (backup), 'R' (root), 'D'
(designated), '-' (non-stp)


.B rstpctl showportdetail <bridge> [<port> ... ]
displays the spanning tree configuration and status for the specified
ports much more verbosely. If no ports are specified, it displays the
information for all ports of the bridge.

.B rstpctl setbridgestate <bridge> {on|off}
enables/disables the operation of RSTP. When RSTP is configured with
the
.BR rstp
subcommand listed above, the default is enabled.

.B rstpctl setbridgeprio <bridge> <priority>
sets the bridge's priority to <priority>. The priority value is a
number between 0 and 61440 in steps of 4096, and defaults to 32768.
Lower priority values are 'better'. The bridge with the lowest
priority will be elected 'root bridge'.

.B rstpctl sethello <bridge> <time>
sets the bridge's 'bridge hello time' to <time> seconds.

.B rstpctl setmaxage <bridge> <time>
sets the bridge's 'maximum message age' to <time> seconds.

.B rstpctl setfdelay <bridge> <time>
sets the bridge's 'bridge forward delay' to <time> seconds.

.B rstpctl setforcevers <bridge> {normal|slow}
sets the bridge's spanning tree algorithm to operate in normal
(i.e. RSTP) mode or force it to operate in slow (i.e. old STP)
mode. In normal mode, RSTP falls back to STP on ports where it
sees other hosts operating in STP mode.

.B rstpctl setportprio <bridge> <port> <priority>
sets the ports's priority to <priority>. The priority value is a
number from 0 to 240 in steps of 16, defaulting to 128.

.B rstpctl setportpathcost <bridge> <port> <cost>
sets the ports's path cost to <cost>. This is by default set
automatically based on the link speed. This setting overrides the
automatic setting. Setting this to zero puts it back in automatic
mode.

.B rstpctl setportedge <bridge> <port> {yes|no}
sets or unsets the port's configures as an edge port. If a port is an
edge port, then it is assumed to be a leaf link in the graph, not
connected to any other bridges. Receiving any STP BPDU's on a port
configured as an edge port turns off edge port behaviour for the port.

.B rstpctl setportnonstp <bridge> <port> {yes|no}
: Setting this to yes disables RSTP operation on the port, which then
is always kept in FORWARDING state.

.B rstpctl portmcheck <bridge> <port>
: This command is used when the port is operating in STP compatibility
mode. I causes the bridge to transmit RSTP BPDUs and to test the
hypothesis that non RSTP hosts have been removed from the LAN
connected to the port, and if that is the case, the remaining hosts
switch back to RSTP mode.

.B rstpctl debuglevel <level>
sets the level of verbosity of rstpd's logging.

.SH NOTES
TODO: Indicate lack of persistence of configuration across restarts of
daemon.

.SH SEE ALSO
.BR rstpd(8),
.BR brctl(8)

.SH COPYRIGHT
This manual page Copyright (c) 2006 EMC Corporation.

This manual page is free software; you can redistribute it and/or modify it 
under the terms of the GNU General Public License as published by the Free 
Software Foundation; either version 2 of the License, or (at your option) 
any later version. It comes with NO WARRANTY.
.\" The full GNU General Public License is included in this distribution in the
.\" file called LICENSE.

.SH AUTHOR
Srinivas Aji <Aji_Srinivas@emc.com>
